<?php
/**
 * Created by PhpStorm.
 * User: Sing
 * Date: 16/10/18
 * Time: 14:05
 */
ini_set("display_errors", "On");//开启错误显示
define('INDEX', true);
require_once '../Lib/Sing_core.php';
if($_GET['pwd'] != 'xlpushjf123qweasd') exit;

$page = intval($_GET['page']);
$pagesize = intval($_GET['pagesize']);
$_GET['mid'] = 'DJEHBSUAAY';
$where = ' order_status=1';
$data = C::t('#api#order')->getlist($where,$page,$pagesize);
var_dump($where);
var_dump($data);
$order = $data['list'];
if(is_array($order)){
    if(count($order)>0){
        echo '开始执行<br>';
        foreach($order as $order_id => $v){
            echo '订单号码:'.$v['id'].'<br />';
            //推送积分
            C::t('#api#xlmembercard')->pointOrderPushAdd($v['id']);
        }
    ?>
        <script>
            setTimeout(function(){
                location.href = '/Manual/pushjf.php?pwd=<?=$_GET['pwd']?>&page=<?=($page+1)?>';
            },2000);
        </script>
    <?php
    }else{
        echo '暂无数据';
    }
}
exit;